<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>由文件或 URL 创建一个新图象。</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.imagecreatefromwebp.html">imagecreatefromwebp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imagecreatefromxpm.html">imagecreatefromxpm</a></div>
 <div class="up"><a href="ref.image.html">GD and Image 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.imagecreatefromxbm" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">imagecreatefromxbm</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.0.1, PHP 5)</p><p class="refpurpose"><span class="refname">imagecreatefromxbm</span> &mdash; <span class="dc-title">由文件或 URL 创建一个新图象。</span></p>

   </div>
 <div class="refsect1 description" id="refsect1-function.imagecreatefromxbm-description">
  <h3 class="title">说明</h3>
    <div class="methodsynopsis dc-description">
     <span class="type">resource</span> <span class="methodname"><strong>imagecreatefromxbm</strong></span>
      ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>
     )</div>

    <p class="para rdfs-comment">
     <span class="function"><strong>imagecreatefromxbm()</strong></span>
     返回一图像标识符，代表了从给定的文件名取得的图像。
    </p>
    <div class="tip"><strong class="tip">Tip</strong><p class="simpara">如已启用<a href="filesystem.configuration.html#ini.allow-url-fopen" class="link">fopen 包装器</a>，在此函数中， URL 可作为文件名。关于如何指定文件名详见 <span class="function"><a href="function.fopen.html" class="function">fopen()</a></span>。各种
wapper 的不同功能请参见 <a href="wrappers.html" class="xref">支持的协议和封装协议</a>，注意其用法及其可提供的预定义变量。</p></div>
    <div class="warning"><strong class="warning">Warning</strong><p class="para">Windows 版本的 PHP 在 4.3.0
版之前不支持通过此函数访问远程文件，即使已经启用 <a href="filesystem.configuration.html#ini.allow-url-fopen" class="link">allow_url_fopen</a>.
</p></div>
   </div>

 <div class="refsect1 parameters" id="refsect1-function.imagecreatefromxbm-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">filename</code></em></dt>

     <dd>

      <p class="para">
       Path to the XBM image.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagecreatefromxbm-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">成功后返回图象资源,失败后返回 <strong><code>FALSE</code></strong> 。</p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.imagecreatefromxbm-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3147">
    <p><strong>Example #1 Convert an XBM image to a png image using <span class="function"><strong>imagecreatefromxbm()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Load&nbsp;the&nbsp;xbm&nbsp;file<br /></span><span style="color: #0000BB">$xbm&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecreatefromxbm</span><span style="color: #007700">(</span><span style="color: #DD0000">'./example.xbm'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Convert&nbsp;it&nbsp;to&nbsp;a&nbsp;png&nbsp;file<br /></span><span style="color: #0000BB">imagepng</span><span style="color: #007700">(</span><span style="color: #0000BB">$xbm</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'./example.png'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagedestroy</span><span style="color: #007700">(</span><span style="color: #0000BB">$xbm</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

 <div class="refsect1 notes" id="refsect1-function.imagecreatefromxbm-notes">
  <h3 class="title">注释</h3>
  <div class="warning"><strong class="warning">Warning</strong><p class="para">Windows 版本的 PHP 在 4.3.0
版之前不支持通过此函数访问远程文件，即使已经启用 <a href="filesystem.configuration.html#ini.allow-url-fopen" class="link">allow_url_fopen</a>.
</p></div>
 </div>

  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.imagecreatefromwebp.html">imagecreatefromwebp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imagecreatefromxpm.html">imagecreatefromxpm</a></div>
 <div class="up"><a href="ref.image.html">GD and Image 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
